<?php

namespace api\controller;

// +----------------------------------------------------------------------
// | 字段设置数据控制层
// +----------------------------------------------------------------------

use common\controller\VerifyController;
use common\service\FieldService;
use think\Exception;
use think\Request;
use think\Response;

class FieldController extends VerifyController
{
    /**
     * @var FieldService
     */
    protected FieldService $fieldService;

    public function __construct()
    {
        parent::__construct();
        $this->fieldService = FieldService::getInstance();
    }

    /**
     * 自动刷新字典配置和缓存
     * @param Request $request
     * @return Response
     * @throws Exception
     */
    public function autoFixFieldConfigAndCache(Request $request)
    {
        $this->fieldService->autoFixFieldConfigAndCache();
        return json(success_response(''));
    }
}
